<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>排序算法可视化</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="container">
        <h1>排序算法可视化演示</h1>
        <div class="controls">
            <div id="algorithm-explanation" class="explanation"></div>
            <select id="algorithm" onchange="updateAlgorithmExplanation(this.value)">
                <option value="bubble">冒泡排序</option>
                <option value="quick">快速排序</option>
                <option value="heap">堆排序</option>
            </select>
            <button onclick="startSort()">开始排序</button>
            <button onclick="resetArray()">重置数组</button>
            <label>速度：</label>
            <input type="range" id="speed" min="10" max="200" value="50" 
                   oninput="updateSpeed(this.value)">
        </div>
        <div id="visualization"></div>
    </div>
    <script src="sort.js"></script>
</body>
</html>